<template>
  <div class="srbd">
    <div class="bd">
      <div class="cesaun_container">
        <h3 class="title">
          <p class="line">指纹占卜</p>
        </h3>
        <div>
          <div style="text-align: center">
            <p style="padding: 20px">
              占卜方法：根据图示选择自己的手指指纹，男性测试左手，女性测试右手。选择好后点击立即测算，并查看测算结果，请自行体会其中的吉凶指示。
            </p>
            <div style="display: flex; gap: 10px; justify-content: center">
              <img
                src="@/assets/image/zhiwen.gif"
                style="width: 83px; height: 87px"
                alt=""
              />
            </div>
            <div>
              <el-form :model="form" ref="form" label-width="60px">
                <!-- 姓名 -->

                <el-form-item label="拇指" prop="muzhi">
                  <el-radio-group v-model="form.muzhi">
                    <el-radio :label="0">螺纹</el-radio>
                    <el-radio :label="1">簸箕纹</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="食指" prop="shizhi">
                  <el-radio-group v-model="form.shizhi">
                    <el-radio :label="0">螺纹</el-radio>
                    <el-radio :label="1">簸箕纹</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="中指" prop="zhongzhi">
                  <el-radio-group v-model="form.zhongzhi">
                    <el-radio :label="0">螺纹</el-radio>
                    <el-radio :label="1">簸箕纹</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="无名指" prop="wumingzhi">
                  <el-radio-group v-model="form.wumingzhi">
                    <el-radio :label="0">螺纹</el-radio>
                    <el-radio :label="1">簸箕纹</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="小拇指" prop="xiaozhi">
                  <el-radio-group v-model="form.xiaozhi">
                    <el-radio :label="0">螺纹</el-radio>
                    <el-radio :label="1">簸箕纹</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-form>
            </div>
            <p style="padding: 20px">
              什么是指纹占卜：因为世界上绝对找不到两个指纹完全相同的人，虽然我们的身体是由遗传所造成，且随着环境会发生变化，但只有指纹始终不会发生变化。指纹，大致可分为“箩纹”和“簸箕纹”两种。随着形状的不同，其性格和命运也不相同。
            </p>
          </div>
        </div>
        <div style="text-align: center">
          <el-button type="primary" @click="submitForm" style="margin: 20px"
            >测算</el-button
          >
        </div>

        <!-- 主体表单 -->
      </div>
      <div>
        <h3 class="title">
          <p class="line">测算简介</p>
        </h3>
        <div style="font-size: 14px; margin: 0 10px 20px 10px">
          <p style="">
            1.箩纹：大致上为同心圆或螺旋状、旋涡状纹路，形如圆形的竹箩，亦称为斗纹、涡纹。也有双斗纹、蚊香状双线螺旋纹，总之，指纹的外围圈是闭合的，一般归类于斗纹。
          </p>
          <p>
            2.簸箕纹：外围有开口，如高山流水般的纹路，形如铲状的簸箕，亦称为流纹。开口朝向同一只手小指方向的为正箕纹，反之为反箕纹，一般情况下很少有反箕纹，它属于基因突变的形成。反箕纹和正箕纹所具有的个性也有很大反差。
          </p>

          <p>2.心诚则灵，测算结果仅供参考。</p>
        </div>
      </div>
    </div>
    <el-dialog
      title="测算结果"
      :visible.sync="centerDialogVisible"
      width="50%"
      class="dialog_cesuan"
    >
      <div class="bazi_info" v-if="result != null">
        <div class="base_info">
          <div class="details">
            <div class="names">
              <span>诗曰:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["诗曰"] }}</span>
            </div>
          </div>
          <div class="details">
            <div class="names">
              <span>性格:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["性格"] }}</span>
            </div>
          </div>

          <div class="details">
            <div class="names">
              <span>婚姻:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["婚姻"] }}</span>
            </div>
          </div>
          <div class="details">
            <div class="names">
              <span>职业:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["职业"] }}</span>
            </div>
          </div>
          <div class="details">
            <div class="names">
              <span>健康:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["健康"] }}</span>
            </div>
          </div>
          <div class="details">
            <div class="names">
              <span>运势:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["运势"] }}</span>
            </div>
          </div>
          <div class="details">
            <div class="names">
              <span>分析:</span>
            </div>
            <div class="des">
              <span class="des_deta">{{ result.description["分析"] }}</span>
            </div>
          </div>
        </div>
        <div class="yl">
          <span>仅供娱乐！请勿当真</span>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  computed: {
    currentPath() {
      return this.$route.path; // 获取当前路由路径
    },
  },
  data() {
    return {
      centerDialogVisible: false,
      birthday: "",
      form: {
        muzhi: 1,
        shizhi: 0,
        zhongzhi: 0,
        wumingzhi: 0,
        xiaozhi: 0,
      },
      result: {
        muzhi: "箩纹",
        shizhi: "箩纹",
        zhongzhi: "箩纹",
        wumingzhi: "箩纹",
        xiaozhi: "箩纹",
        description: {
          分析: "有信念，办事积极认真努力，能创造，讲究发明，经常体壮，不听人意见。",
          诗曰: "信念坚深为人直，贫贱不移威不屈。行正得尊邪入寇，躬身修行富贵职。",
          性格: "博学多文型，是领袖级的人物，有超人的记忆力，可与他人祸福与共，对任何事都有信心勇往直前，中年运势会很好。中年以后会做到主管的位置，男人英俊潇洒，和全有流纹之人将会主宰新世界，子孙都很优秀，会为大众谋福利。",
          婚姻: "男人会有一颗温和善良的心来对待自己的伴侣。女人是保守且老练的，是个诚挚有礼的贤妻良母。",
          职业: "政治家。企划人员。顾问谘询家。独立事业。企业管理事业。",
          健康: "注意神经机能衰弱，心脏、脑部、胃肠。",
          运势: "必须知道养兵千日用在一时，平日应好好充实自己，遇到挫折不要因为一时的失败而气馁，只要在工作上好好努力，成功是指日可待。",
        },
      },
      area: "",
    };
  },
  mounted() {},
  methods: {
    submitForm() {
      this.form["api_key"] = "FNcQHQuf0W8wDrXMjWc0xqTzw";
      let config = {
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
        },
      };
      this.$axios
        .post(window.config.apiUrl + "/v1/Zhanbu/zhiwen", this.form, config)
        .then((res) => {
          if (res.data.errcode == -1) {
            this.$message({
              type: "warning",
              message: res.data.errmsg,
            });

            return;
          }

          this.centerDialogVisible = true;
          this.result = res.data.data;
          console.log(this.result);
        });
    },
  },
};
</script>

<style scoped lang="scss">
.bd {
  border: 1px solid #e5e5e5;
}

.cesaun_container {
}

::v-deep .el-card.is-always-shadow {
  box-shadow: none !important;
}

::v-deep .el-card__header {
  padding: 10px 20px !important;
}

.form-card {
  width: 100%;
  margin: 0 auto;
  border-radius: 2px;
}

.form-title {
  margin: 0;
  color: #303133;
  font-size: 16px;
  text-align: left;
}

.el-form-item {
  margin-bottom: 22px;
}

.el-radio {
  margin-right: 30px;
}

::v-deep .distpicker-address-wrapper {
  width: 100% !important;
}

@mixin flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  height: 45px;
}

@mixin tr1_w {
  width: 33px;
  text-align: center;
}

.dialog_cesuan {
  .bazi_info {
    height: 85vh;
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;

    .base_info {
      margin: 20px;

      .title {
        display: flex;
        padding: 5px;

        .shu {
          width: 5px;
          height: 20px;
          background-color: #e6a84b;
          border-radius: 10px;
        }

        .ti {
          padding-left: 8px;
          font-weight: 800;
          font-size: 15px;
        }
      }

      .show {
        margin-top: 15px;

        .l_ {
          font-size: 14px;
          display: inline-block;
          min-width: 50px;
          font-weight: 800;
        }

        .l {
          font-size: 15px;
          display: inline-block;
          min-width: 50px;
          font-weight: 800;
        }
      }

      .details {
        border: 1px solid #e5e5e5;
        border-bottom: none;
        margin-top: 20px;

        .names {
          text-align: center;
          color: #e6a84b;
          border-bottom: 1px solid #e5e5e5;
          color: #e6a84b;
          font-weight: 800;
          background-color: #fff3ef;
          height: 50px;
          line-height: 50px;
        }

        .des {
          border-bottom: 1px solid #e5e5e5;
          padding-left: 10px;
          display: flex;
          align-items: center;

          .des_text {
            color: #e6a84b;
            width: 14%;
            font-weight: 800;
            user-select: text;
          }

          .des_deta {
            width: 85%;
            line-height: 26px;
            text-indent: 2em;
            user-select: text;
          }
        }
      }
    }
  }
}
</style>